package com.designoutput.service
{
	public class GalleryService extends ServiceBase
	{
		//Singleton
		private static var _instance:GalleryService;
		private static var _allowInstantiation:Boolean = false;
		
		public function GalleryService()
		{
			if(!_allowInstantiation)
				throw new Error("This class is singleton, use the static property instance.");
		}
		
		public static function get instance():GalleryService {
			if(_instance == null)
			{
				_allowInstantiation = true;
				
				_instance = new GalleryService();
				
				_allowInstantiation = false;
			}
			
			return _instance;
		}
		//
		
		public static const GET_GALLERIES:String="myGetgalleries.php";
		public static const GET_GALLERIES_WORDS:String="getGalleriesWords.php";
		public static const SEARCH_GALLERIES:String="searchGalleries.php";
		
		
		public function getGalleries(onComplete:Function = null, onError:Function = null):void
		{
			call(GET_GALLERIES, { }, onComplete, onError);
		}
		
		public function getGalleriesWords(onComplete:Function = null, onError:Function = null):void
		{
			call(GET_GALLERIES_WORDS, { }, onComplete, onError);
		}
		
		public function searchGalleries(keyWord:String, onComplete:Function = null, onError:Function = null):void
		{
			call(SEARCH_GALLERIES, { keyWord: keyWord }, onComplete, onError);
		}
	}
}